// * 面试筛选模块下table column字段
import { resumeUploadStatus, resumeSearchStatus } from './status'

// * 简历上传
export const resumeUploadTableColumn = [
  {
    name: "需求编号",
    value: "needs_code",
    width: '190px',
    render: (h, { row, listeners }) => {
      return h('div', {}, [
        h('span', {
          class: `
          ${ row.closeState  === 1? 'needsFinished': '' }
          ${ row.suspendState  === 1? 'pause': '' }
          ${ row.suspendState === 2? 'restore': '' }
          ${ row.closeState === 2? 'close': '' }
        `,
        }, [
          h('span', {}, row.needs_code),
          row.reuse === 1? h('span', { class: 'multiplex' }, ''): '',
        ])
      ])
    }
  },
  {
    name: "岗位名称",
    value: "positionName",
  },
  {
    name: "需求人数",
    value: "needs_number",
  },
  {
    name: "一级部门",
    value: "dept_1",
  },
  {
    name: "二级部门",
    value: "dept_2",
  },
  {
    name: "三级部门",
    value: "dept_3",
  },
  {
    name: "四级部门",
    value: "dept_4",
  },
  {
    name: "五级部门",
    value: "dept_5",
  },
  {
    name: "期望入场时间",
    value: "begin_time",
    width: '110px'
  },
  {
    name: "状态",
    render: (h, { row }) => {
      return h('span', {
        class: `${resumeUploadStatus[row.state].className}`
      } , [
        h('span', {
          class: 'circle'
        }, null),
        h('span', null, resumeUploadStatus[row.state].label)
      ])
    }
  },
  {
    name: "操作",
    type: "operate",
    width: "150px",
    fixed: "right",
    render: (h, { row, listeners }) => {
      return h('div', {}, [
        h(
          "span",
          {
            class: "cursor table-btn table-blue-btn",
            on: {
              click: function () {
                listeners.click("lookResumeDetail");
              },
            },
          },
          "查看"
        ),
        row.remind === 1? h(
          "span",
          {
            class: "cursor table-btn table-blue-btn",
            on: {
              click: function () {
                listeners.click("onRemind");
              },
            },
          },
          "简历筛选提醒"
        ): '',
      ])
    },
  },
]

// * 简历查询
export const resumeSearchTableColumn = [
  {
    name: "需求编号",
    value: "needs_code",
    width: '190px',
    render: (h, { row, listeners }) => {
      return h('div', {}, [
        h('span', {
          class: `
          ${ row.closeState  === 1? 'needsFinished': '' }
          ${ row.suspendState  === 1? 'pause': '' }
          ${ row.suspendState === 2? 'restore': '' }
          ${ row.closeState === 2? 'close': '' }
          `,
        }, [
          h('span', {}, row.needs_code),
          row.reuse === 1? h('span', { class: 'multiplex' }, ''): '',
        ])
      ])
    }
  },
  {
    name: "需求创建人",
    value: "createrName",
  },
  {
    name: "岗位名称",
    value: "positionName",
  },
  {
    name: "姓名",
    value: "surname",
    width: '100px'
  },
  {
    name: "学历",
    value: "education_code",
  },
  {
    name: "工作年限",
    value: "work_experience",
    width: '80px'
  },
  {
    name: "上传时间",
    value: "create_date",
    width: '100px'
  },
  {
    name: "筛选状态",
    width: '100px',
    render: (h, { row }) => {
      return h('span', {
        class: `${resumeSearchStatus[row.is_selected].className}`
      } , [
        h('span', {
          class: 'circle'
        }, null),
        h('span', null, resumeSearchStatus[row.is_selected].label)
      ])
    }
  },
  {
    name: "操作",
    type: "operate",
    width: "80px",
    fixed: "right",
    render: (h, { row, listeners }) => {
      return h(
        "span",
        {
          class: "cursor table-btn table-blue-btn",
          on: {
            click: function () {
              listeners.click("onLookDetail");
            },
          },
        },
        "查看"
      );
    },
  },
]
